package com.molin.StreamTest;

import java.util.ArrayList;
import java.util.List;

public class Demo6 {
    public static void main(String[] args) {
        ArrayList<Integer> list=new ArrayList<>(List.of(1,2,3,4,5,6,7,8,9,10));
        //获取偶数
        list.stream().filter((number)->{return number%2==0;}).forEach(s-> System.out.println(s));
        System.out.println("华丽的分割线----------------");
        for (Integer integer : list) {
            System.out.println(integer);
        }
    }
}
